<template>
  <div class="biguanxl">
    <div class="xiangqing-header">
      <img @click="Back()" class="back" src="../../assets/img/shouye/header-xinpin/back.png" />
      <p>修炼秘籍</p>
      <img @click="fenxiang()" class="share" src="../../assets/img/shouye/header-xinpin/share.png" />
    </div>
    <ul>
      <li>
        <router-link :to="{name: 'xlmj-xiangqing'}">
          <div class="datu">
            <img src="../../assets/img/shouye/shouye-zeidianji/zhuanbian.png" alt="">
          </div>
        </router-link>
        <div class="bgxl">
          <h3>
            ADDICTION
          </h3>
          <h4>
            质感奢华 宛如定制
          </h4>
        </div>
      </li>
      <li>
        <div class="datu">
          <img src="../../assets/img/shouye/shouye-zeidianji/zhuanbian.png" alt="">
        </div>
        <div class="bgxl">
          <h3>
            ADDICTION
          </h3>
          <h4>
            质感奢华 宛如定制
          </h4>
        </div>
      </li>
      <li>
        <div class="datu">
          <img src="../../assets/img/shouye/shouye-zeidianji/zhuanbian.png" alt="">
        </div>
        <div class="bgxl">
          <h3>
            ADDICTION
          </h3>
          <h4>
            质感奢华 宛如定制
          </h4>
        </div>
      </li>
    </ul>
    <div class="fenxiang-mengban" v-if="isFX">
      <div class="fenxiang">
        <ul>
          <li>
            <ul class="fenxiang-list">
              <li>
                <div>
                  <img src="../../assets/img/shouye/fenxiang/pengyouquan.png"/>
                </div>
                <p>微信朋友圈</p>
              </li>
              <li>
                <div>
                  <img src="../../assets/img/shouye/fenxiang/weixin.png" /></div>
                <p>微信好友</p>
              </li>
              <li>
                <div>
                  <img src="../../assets/img/shouye/fenxiang/QQ.png"/></div>
                <p>QQ好友</p>
              </li>
            </ul>
          </li>
          <li>
            <ul class="fenxiang-list">
              <li>
                <div>
                  <img src="../../assets/img/shouye/fenxiang/QQkongjian.png"/></div>
                <p>QQ空间</p>
              </li>
              <li>
                <div>
                  <img src="../../assets/img/shouye/fenxiang/weibo.png" /></div>
                <p>微博</p>
              </li>
              <li>
                <div>
                  <img src="../../assets/img/shouye/fenxiang/fuzhilianjie.png"/></div>
                <p>复制链接</p>
              </li>
            </ul>
          </li>
        </ul>
        <div @click="quxiao()">
          取消
        </div>
      </div>
    </div>
    <div class="up" @click="toTop()" v-if="isUP">
      <img src="../../assets/img/shouye/tuijian-xuanliyanzhuang/toTop.png"/>
    </div>
  </div>
</template>
<script>
  export default {
    data () {
      return {
        isFX: false,
        isUP: false
      }
    },
    methods: {
      Back () {
        this.$router.go(-1)
      },
      fenxiang () {
        this.isFX = true
      },
      quxiao () {
        this.isFX = false
      },
      toTop () {
        if(document.documentElement){
          document.documentElement.scrollTop = 0;
        }else{
          document.body.scrollTop = 0;
        }
      },
      menu() {
        this.scroll = document.documentElement.scrollTop || document.body.scrollTop;
        if(this.scroll > 0){
          //显示 a 标签
          this.isUP = true;
        }else{
          //隐藏 a 标签
          this.isUP = false;
        }
      },
      top () {
        window.scrollTo(0,0)
      }
    },
    mounted() {
      window.addEventListener('scroll', this.menu)
    },
    created () {
      this.top();
    }
  }
</script>
<style scoped>
  .biguanxl {
    position: relative;
    width: 100%;
    padding-top: 2rem;
    background: #f2f2f2;
  }
  .xiangqing-header {
    width: 100%;
    height: 2rem;
    line-height: 2rem;
    background: #e53e42;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
  }
  .back {
    vertical-align: middle;
    width: 0.6rem;
    margin-left: 0.5rem;
  }
  .xiangqing-header>p{
    width: 12.5rem;
    height: 100%;
    text-align: center;
    display: inline-block;
    font-family: MicrosoftYaHei;
    font-size: 0.7rem;
    font-weight: normal;
    font-stretch: normal;
    color: #ffffff;
  }
  .share {
    vertical-align: middle;
    width: 1rem;
  }
  .datu {
    padding-bottom: 0;
    font-size: 0;
  }
  .datu img{
    width: 100%;
  }
  .bgxl {
    font-family: MicrosoftYaHei;
    font-size: 0.7rem;
    font-weight: normal;
    color: #4d4d4d;
    padding: 0.2rem;
    background: #fff;
  }
  .fenxiang-mengban {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    background: rgba(0,0,0,0.5);
  }
  .fenxiang {
    padding-top: 1rem;
    background: #fff;
    width: 100%;
    height: 10rem;
    position: absolute;
    bottom: 0;
    left: 0;
  }
  .fenxiang-list {
    display: flex;
  }
  .fenxiang-list li {
    flex: 1;
    text-align: center;
  }
  .fenxiang-list div {
    width: 1.5rem;
    height: 1.5rem;
    margin: 0.5rem auto;
  }
  .fenxiang-list div img {
    width: 100%;
  }
  .fenxiang-list p {
    font-size: 0.6rem;
    font-weight: normal;
    font-stretch: normal;
    color: #4d4d4d;
  }
  .fenxiang>div {
    font-size: 0.6rem;
    font-weight: normal;
    font-stretch: normal;
    background: #e53e42;
    color: #fff;
    width: 3rem;
    text-align: center;
    padding: 0.2rem;
    border-radius: 0.2rem;
    margin: 0.5rem auto;
  }
  .up {
    width: 1.5rem;
    position: fixed;
    bottom: 0;
    right: 0.3rem;
  }
  .up img {
    width: 100%;
  }
</style>
